package com.ces.knacky.model;

import java.io.Serializable;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractParentEntity;

/** @author Hibernate CodeGenerator */
public class Country extends AbstractParentEntity  implements Serializable {

    /** persistent field */
    private String code;

    /** persistent field */
    private Set locations;

    /** persistent field */
    private Set states;

    /** full constructor */
    public Country(String description, String code, com.ces.knacky.model.Flag flag, Set locations, Set states) {
        this.description = description;
        this.code = code;
        this.flag = flag;
        this.locations = locations;
        this.states = states;
    }

    /** default constructor */
    public Country() {
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String countryCode) {
        this.code = countryCode;
    }

    public Set getLocations() {
        return this.locations;
    }

    public void setLocations(Set locations) {
        this.locations = locations;
    }

    public Set getStates() {
        return this.states;
    }

    public void setStates(Set states) {
        this.states = states;
    }

     public boolean equals(Object other) {
        if ( !(other instanceof Country) ) return false;
        Country castOther = (Country) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }
}
